package com.itany.boot.nmms.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 我的配置
 *
 * @author Tom
 * @date 2021/06/08
 */
@Configuration
public class MyConfig implements WebMvcConfigurer {
    /**
     * 添加拦截器
     *
     * @param registry 注册表
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {

    }

    /**
     * 添加视图控制器
     *
     * @param registry 注册表
     */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/nmms/login").setViewName("backend/login");
        registry.addViewController("/nmms/main").setViewName("backend/main");

    }
}
